<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <h:head>
        <title>Supervisor - Search House</title>
        <link href="style.css" rel="stylesheet" type="text/css"></link>
        <div style="text-align: center;"><h:graphicImage url="/Images/back.png"></h:graphicImage></div>

    </h:head>
    <h:body>
        <h:form prependId="false">
            <div id="wrapper">
                <div id="logo">

                </div>
                <div id="header">
                    <!-- 		<div id="menu">
                    
                            </div>    -->
                </div>
                <div class="page">
                    <div id="page-bgtop">

                        <div id="dummy"></div>
                         <p:panel id="panelsidebar" header="Pages Menu">
                            <ui:include src="MenuSupervisor.xhtml"/>
                        </p:panel>

                        <!-- end #sidebar -->

                        <div id="content">
                            <p:panel header="House Details" id="panel">
                                

                                   <p:galleria effect="#{supervisorbean.effect}" effectSpeed="1000">
                                       <ui:repeat value="#{supervisorbean.imagesHouse}" var="image">
                                        <p:graphicImage value="//Images/#{image}"
                                                        title="#{image}" alt="Description goes here"/>
                                    </ui:repeat>
                                </p:galleria>
                               
                                 <h:panelGrid columns="2" id="grid">

                                     <h:outputText value="City"/>
                                   <h:selectOneMenu id="city" value="#{supervisorbean.city}">
                                        <f:selectItem itemLabel="Select City" itemValue="" />
                                        <f:selectItems value="#{supervisorbean.cities}" />
                                        <p:ajax update="suburbs" 
                                                listener="#{supervisorbean.handleCityChange}" />
                                    </h:selectOneMenu>
                                   
                                    <h:outputText value="District"/>
                                    <h:selectOneMenu id="suburbs" value="#{supervisorbean.suburb}" >
                                        <f:selectItem itemLabel="Select Suburb" itemValue="" />
                                        <f:selectItems value="#{supervisorbean.suburbs}" />
                                    </h:selectOneMenu>
                                    <h:outputText value="Type"/>
                                    <h:selectOneMenu id="types" value="#{supervisorbean.type}" >
                                        <f:selectItem itemLabel="Select Type" itemValue="" />
                                        <f:selectItems value="#{supervisorbean.types}" />
                                    </h:selectOneMenu>
                                    <h:outputText value="Room Type: "/>
                                    <h:selectOneMenu id="roomTypes" value="#{supervisorbean.roomType}" >
                                        <f:selectItem itemLabel="Select Room Type" itemValue="" />
                                        <f:selectItems value="#{supervisorbean.roomTypes}" />
                                    </h:selectOneMenu>
                                    <h:outputText value="Description: "/>
                                    <p:inputTextarea value="#{supervisorbean.selectedHouse.description}" style="width:300px;height:100px;" effectDuration="400" />
                                    <h:outputText value="Combi: "/>
                                    <h:selectBooleanCheckbox value="#{supervisorbean.selectedHouse.isCombi}"/> 
                                    <h:outputText value="Double Glazing: "/>
                                    <h:selectBooleanCheckbox value="#{supervisorbean.selectedHouse.isDoubleGlazing}"/>
                                    <h:outputText value="Balcony: "/>
                                    <h:selectBooleanCheckbox value="#{supervisorbean.selectedHouse.isBalcony}"/>
                                    <h:outputText value="Cable TV: "/>
                                    <h:selectBooleanCheckbox value="#{supervisorbean.selectedHouse.isCableTV}"/>
                                    <h:outputText value="Elevator: "/>
                                    <h:selectBooleanCheckbox value="#{supervisorbean.selectedHouse.isElevator}"/>
                                    <h:outputText value="Fire Alarm: "/>
                                    <h:selectBooleanCheckbox value="#{supervisorbean.selectedHouse.isFireAlarm}"/>
                                    <h:outputText value="Park: "/>
                                    <h:selectBooleanCheckbox value="#{supervisorbean.selectedHouse.isPark}" />
			
                                </h:panelGrid>

                                <h:panelGrid columns="2">
                                    <p:commandButton update="panel" value="Update" action="#{supervisorbean.updateHouse()}"></p:commandButton>		
                                    <p:commandButton update="panel" value="Delete"></p:commandButton>		

                                </h:panelGrid>     
                                <p:messages/>
                            </p:panel>

                        </div>
                        <!-- end #content -->

                        <div style="clear: both;">&nbsp;</div>
                    </div>

                    <!-- end #page -->

                </div>
                <div id="footer-bgcontent">
                    <div id="footer" align="center">
                        <p>İstanbul Teknik Üniversitesi - Software Engineering Course - Real Estate Management</p>
                    </div>
                </div>
                <!-- end #footer -->
            </div>

        </h:form>
    </h:body>
</html>